.class public Llt/noframe/gpsfarmguide/models/MeasuringModel;
.super Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;
.source "MeasuringModel.java"

# interfaces
.implements Ljava/io/Serializable;


# instance fields
.field private active:Z

.field private active_type:I

.field private fromGps:Z

.field private fromImport:Z

.field private group:I

.field private id:I

.field private measuringType:I

.field private name:Ljava/lang/String;

.field private uniqueId:Ljava/lang/String;


# direct methods
.method public constructor <init>(Llt/noframe/gpsfarmguide/interfaces/Shape;I)V
    .locals 1

    .line 31
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;-><init>(Llt/noframe/gpsfarmguide/interfaces/Shape;)V

    const/4 p1, 0x0

    .line 20
    iput p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->id:I

    const-string v0, ""

    .line 21
    iput-object v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->name:Ljava/lang/String;

    .line 25
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->fromGps:Z

    .line 26
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->fromImport:Z

    const/4 v0, 0x1

    .line 27
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->active:Z

    .line 28
    iput p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->active_type:I

    .line 32
    iput p2, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->measuringType:I

    return-void
.end method

.method public constructor <init>(Llt/noframe/gpsfarmguide/interfaces/Shape;IZ)V
    .locals 1

    .line 36
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;-><init>(Llt/noframe/gpsfarmguide/interfaces/Shape;)V

    const/4 p1, 0x0

    .line 20
    iput p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->id:I

    const-string v0, ""

    .line 21
    iput-object v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->name:Ljava/lang/String;

    .line 25
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->fromGps:Z

    .line 26
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->fromImport:Z

    const/4 v0, 0x1

    .line 27
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->active:Z

    .line 28
    iput p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->active_type:I

    .line 37
    iput p2, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->measuringType:I

    .line 38
    iput-boolean p3, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->fromGps:Z

    return-void
.end method

.method private insertNextMidPoint(Lcom/google/android/gms/maps/model/Marker;)V
    .locals 2

    .line 112
    invoke-virtual {p1}, Lcom/google/android/gms/maps/model/Marker;->getPosition()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getNextMarker(Lcom/google/android/gms/maps/model/Marker;)Lcom/google/android/gms/maps/model/Marker;

    move-result-object v1

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Marker;->getPosition()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-static {v0, v1}, Llt/noframe/gpsfarmguide/utils/Mathematics;->getMidPoint(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    .line 113
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1, p1}, Ljava/util/List;->indexOf(Ljava/lang/Object;)I

    move-result p1

    .line 114
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v1

    add-int/lit8 p1, p1, 0x1

    invoke-interface {v1, p1, v0}, Ljava/util/List;->add(ILjava/lang/Object;)V

    .line 115
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v1

    invoke-static {v0}, Llt/noframe/gpsfarmguide/utils/Drawing;->addMidMarker(Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/Marker;

    move-result-object v0

    invoke-interface {v1, p1, v0}, Ljava/util/List;->add(ILjava/lang/Object;)V

    return-void
.end method

.method private insertPreviousMidPoint(Lcom/google/android/gms/maps/model/Marker;)V
    .locals 2

    .line 100
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getPreviousMarker(Lcom/google/android/gms/maps/model/Marker;)Lcom/google/android/gms/maps/model/Marker;

    move-result-object v0

    invoke-virtual {v0}, Lcom/google/android/gms/maps/model/Marker;->getPosition()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    invoke-virtual {p1}, Lcom/google/android/gms/maps/model/Marker;->getPosition()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-static {v0, v1}, Llt/noframe/gpsfarmguide/utils/Mathematics;->getMidPoint(Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v0

    .line 101
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1, p1}, Ljava/util/List;->indexOf(Ljava/lang/Object;)I

    move-result p1

    if-eqz p1, :cond_0

    .line 103
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1, p1, v0}, Ljava/util/List;->add(ILjava/lang/Object;)V

    .line 104
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v1

    invoke-static {v0}, Llt/noframe/gpsfarmguide/utils/Drawing;->addMidMarker(Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/Marker;

    move-result-object v0

    invoke-interface {v1, p1, v0}, Ljava/util/List;->add(ILjava/lang/Object;)V

    goto :goto_0

    .line 106
    :cond_0
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object p1

    invoke-interface {p1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 107
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object p1

    invoke-static {v0}, Llt/noframe/gpsfarmguide/utils/Drawing;->addMidMarker(Lcom/google/android/gms/maps/model/LatLng;)Lcom/google/android/gms/maps/model/Marker;

    move-result-object v0

    invoke-interface {p1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :goto_0
    return-void
.end method

.method private removeNextMidPoint(Lcom/google/android/gms/maps/model/Marker;)V
    .locals 2

    .line 88
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getNextMarker(Lcom/google/android/gms/maps/model/Marker;)Lcom/google/android/gms/maps/model/Marker;

    move-result-object p1

    .line 89
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    invoke-virtual {p1}, Lcom/google/android/gms/maps/model/Marker;->getPosition()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 90
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 91
    invoke-virtual {p1}, Lcom/google/android/gms/maps/model/Marker;->remove()V

    return-void
.end method

.method private removePreviousMidPoint(Lcom/google/android/gms/maps/model/Marker;)V
    .locals 2

    .line 81
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getPreviousMarker(Lcom/google/android/gms/maps/model/Marker;)Lcom/google/android/gms/maps/model/Marker;

    move-result-object p1

    .line 82
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    invoke-virtual {p1}, Lcom/google/android/gms/maps/model/Marker;->getPosition()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 83
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 84
    invoke-virtual {p1}, Lcom/google/android/gms/maps/model/Marker;->remove()V

    return-void
.end method


# virtual methods
.method public equals(Ljava/lang/Object;)Z
    .locals 4

    const/4 v0, 0x1

    if-ne p0, p1, :cond_0

    return v0

    :cond_0
    const/4 v1, 0x0

    if-eqz p1, :cond_5

    .line 189
    const-class v2, Llt/noframe/gpsfarmguide/models/MeasuringModel;

    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    if-eq v2, v3, :cond_1

    goto :goto_2

    .line 191
    :cond_1
    check-cast p1, Llt/noframe/gpsfarmguide/models/MeasuringModel;

    .line 193
    iget-object v2, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->uniqueId:Ljava/lang/String;

    if-eqz v2, :cond_2

    iget-object p1, p1, Llt/noframe/gpsfarmguide/models/MeasuringModel;->uniqueId:Ljava/lang/String;

    invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-nez p1, :cond_4

    goto :goto_0

    :cond_2
    iget-object p1, p1, Llt/noframe/gpsfarmguide/models/MeasuringModel;->uniqueId:Ljava/lang/String;

    if-nez p1, :cond_3

    goto :goto_1

    :cond_3
    :goto_0
    const/4 v0, 0x0

    :cond_4
    :goto_1
    return v0

    :cond_5
    :goto_2
    return v1
.end method

.method public getGroup()I
    .locals 1

    .line 134
    iget v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->group:I

    return v0
.end method

.method public getId()I
    .locals 1

    .line 42
    iget v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->id:I

    return v0
.end method

.method public getMeasuringType()I
    .locals 1

    .line 58
    iget v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->measuringType:I

    return v0
.end method

.method public getName()Ljava/lang/String;
    .locals 1

    .line 50
    iget-object v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->name:Ljava/lang/String;

    return-object v0
.end method

.method public getNextMarker(Lcom/google/android/gms/maps/model/Marker;)Lcom/google/android/gms/maps/model/Marker;
    .locals 1

    .line 62
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0, p1}, Ljava/util/List;->indexOf(Ljava/lang/Object;)I

    move-result p1

    .line 63
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    if-ne p1, v0, :cond_0

    .line 64
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object p1

    const/4 v0, 0x0

    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/google/android/gms/maps/model/Marker;

    return-object p1

    .line 65
    :cond_0
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    add-int/lit8 p1, p1, 0x1

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/google/android/gms/maps/model/Marker;

    return-object p1
.end method

.method public getPreviousMarker(Lcom/google/android/gms/maps/model/Marker;)Lcom/google/android/gms/maps/model/Marker;
    .locals 1

    .line 69
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0, p1}, Ljava/util/List;->indexOf(Ljava/lang/Object;)I

    move-result p1

    if-nez p1, :cond_0

    .line 71
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object p1

    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/google/android/gms/maps/model/Marker;

    return-object p1

    .line 72
    :cond_0
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    add-int/lit8 p1, p1, -0x1

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/google/android/gms/maps/model/Marker;

    return-object p1
.end method

.method public getUniqueId()Ljava/lang/String;
    .locals 1

    .line 142
    iget-object v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->uniqueId:Ljava/lang/String;

    return-object v0
.end method

.method public insertSideMidPoints(Lcom/google/android/gms/maps/model/Marker;)V
    .locals 1

    .line 119
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->insertPreviousMidPoint(Lcom/google/android/gms/maps/model/Marker;)V

    .line 120
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->insertNextMidPoint(Lcom/google/android/gms/maps/model/Marker;)V

    const-string v0, "marker"

    .line 121
    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/model/Marker;->setSnippet(Ljava/lang/String;)V

    .line 122
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->redraw()V

    return-void
.end method

.method public isFromGps()Z
    .locals 1

    .line 126
    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->fromGps:Z

    return v0
.end method

.method public removeSideMidPoints(Lcom/google/android/gms/maps/model/Marker;)V
    .locals 0

    .line 95
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->removePreviousMidPoint(Lcom/google/android/gms/maps/model/Marker;)V

    .line 96
    invoke-direct {p0, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->removeNextMidPoint(Lcom/google/android/gms/maps/model/Marker;)V

    return-void
.end method

.method public setFromGps(Z)V
    .locals 0

    .line 130
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->fromGps:Z

    return-void
.end method

.method public setGroup(I)V
    .locals 0

    .line 138
    iput p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->group:I

    return-void
.end method

.method public setId(I)V
    .locals 0

    .line 46
    iput p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->id:I

    return-void
.end method

.method public setName(Ljava/lang/String;)V
    .locals 0

    .line 54
    iput-object p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->name:Ljava/lang/String;

    return-void
.end method

.method public setUniqueId(Ljava/lang/String;)V
    .locals 0

    .line 146
    iput-object p1, p0, Llt/noframe/gpsfarmguide/models/MeasuringModel;->uniqueId:Ljava/lang/String;

    return-void
.end method

.method public updatePoint(ILcom/google/android/gms/maps/model/LatLng;)V
    .locals 1

    .line 76
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0, p1, p2}, Ljava/util/List;->set(ILjava/lang/Object;)Ljava/lang/Object;

    .line 77
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->redraw()V

    return-void
.end method
